package com.jiangnan.api.service

import com.jiangnan.entity.Book
import com.jiangnan.entity.PageResult
import com.jiangnan.entity.Res
import com.jiangnan.entity.UserBorrowBookInfo
import retrofit2.http.Body
import retrofit2.http.DELETE
import retrofit2.http.GET
import retrofit2.http.PUT
import retrofit2.http.Path
import retrofit2.http.Query

interface AdminApiService {

    /**
     * 通过ID删除图书
     */
    @DELETE("/admin/delete/{id}")
    suspend fun deleteBookById(
        @Path("id") id: Int
    ): Res<Any>

    /**
     * 更新图书信息
     */
    @PUT("admin/update")
    suspend fun updateBook(
        @Body book: Book
    ): Res<Any>

    /**
     * 查询所有用户的图书借阅情况
     */
    @GET("admin/userInfoList")
    suspend fun getUserInfoList(
        @Query("page") page: Int?,
        @Query("pageSize") pageSize: Int?,
        @Query("requestParam") requestParam: String?
    ): Res<PageResult<UserBorrowBookInfo>>

    /**
     * 修改用户状态
     */
    @PUT("admin/updateUserStatus")
    suspend fun updateUserStatus(
        @Query("id") id: Int,
        @Query("status") status: Int
    ): Res<Any>

}